{include file='header'/}
<body class="pear-admin">
<form class="layui-form" action="{:url('admin/edit')}" method="post">
    <div class="mainBox">
        <div class="main-container">
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Username')}</label>
                <div class="layui-input-block">
                    <input type="text" lay-verify="required" autocomplete="off"
                           placeholder="{:__('PleaseEnter %s',[__('Username')])}"
                           class="layui-input readonly-bg" value="<?php echo $data['username'] ?>" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{:__('Password')}</label>
                <div class="layui-input-block">
                    <input type="password" name="password" autocomplete="off"
                           placeholder="不更改密码请留空"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('RoleGroup')}</label>
                <div class="layui-input-block">
                    {foreach role_group_name as $key=>$val}
                    <input type="checkbox" id="auth_ids" name="auth_ids[]" lay-skin="primary" title="{$val}"
                           lay-verify="required" <?php if($data['id'] == 1 ) echo "disabled"; ?> value="{$key}" {if (in_array($key,$group_access))}checked{/if} >
                    {/foreach}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{:__('Nickname')}</label>
                <div class="layui-input-block">
                    <input type="text" name="nickname" autocomplete="off"
                           placeholder="{:__('PleaseEnter %s',[__('Nickname')])}"
                           class="layui-input" value="<?php echo $data['nickname'] ?>">
                </div>
            </div>

            <div class="layui-form-item huicmf-upload">
                <label class="layui-form-label">{:__('Avatar')}</label>
                <div class="layui-input-block">
                    <input type="text" name="avatar" value="{$data.avatar}"
                           onmouseover="hui_img_preview('avatar-select-input',this.value)"
                           onmouseout="layer.closeAll();" id="avatar-select-input" autocomplete="off"
                           class="layui-input">
                    <button type="button" class="layui-btn layui-btn-normal layUpload" id="picker_pic"
                            data-multiple="false" data-input-id="avatar-select-input"
                            data-preview-id="image" data-type="image"><i class="layui-icon"></i>{:__('UploadImg')}
                    </button>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Email')}</label>
                <div class="layui-input-block">
                    <input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="{:__('PleaseEnter %s',[__('Email')])}"
                           class="layui-input" value="<?php echo $data['email'] ?>">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{:__('Status')}</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="1"
                           title="{:__('Enable')}" <?php if($data['status'] == 'normal') echo "checked" ?>>
                    <input type="radio" name="status" value="0"
                           title="{:__('Disable')}" <?php if($data['status'] == '0') echo "checked" ?>>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <input type="hidden" name="id" value="<?php echo $data['id'] ?>">
            <input type="hidden" name="__token__" value="{:token()}" />
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="form-save">
                <i class="layui-icon layui-icon-ok"></i>
                {:__('Save')}
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                {:__('Reset')}
            </button>
        </div>
    </div>
</form>
{include file='footer'/}

